package com.yikes.srb.controller;

import com.yikes.srb.common.result.Result;
import com.yikes.srb.service.SmsCodeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  短信验证码服务
 * </p>
 *
 * @Author: guanrong.yin
 * @Date: 2024/12/17 14:48
 * @Version: 1.0
 */
@Tag(name = "短信验证码服务")
@RestController
@RequestMapping("/sms_code")
@RequiredArgsConstructor
public class SmsCodeController {

    private final SmsCodeService smsCodeService;

    @Operation(description = "发送短信验证码")
    @PostMapping("/{phone}")
    public Result sendSmsCode(@PathVariable("phone") String phone) {

        smsCodeService.sendSmsCode(phone);
        return Result.ok();
    }
}
